package com.baselibrary.test.adapter;

import android.content.Context;
import android.widget.LinearLayout;

import com.baselibrary.libs.Utils.log.LogUtils;
import com.baselibrary.libs.base.baseAdapter.BaseListViewAdapter;
import com.baselibrary.libs.base.baseAdapter.MyViewHolder;
import com.baselibrary.test.R;
import com.baselibrary.test.View.myUi;
import com.baselibrary.test.bean.listJson;

import java.util.List;

/**
 * Created by Administrator 于萌萌
 * 创建日期: 11:43 . 2017年03月06日
 * 描述:
 * <p>
 * <p>
 * 备注:
 */

public class ssItemlistView extends BaseListViewAdapter<listJson.DataBean> {
    public ssItemlistView(Context context, int type, List<listJson.DataBean> datas) {
        super(context, type, datas);
    }

    @Override
    public int getViewType(listJson.DataBean listJson, int position) {
        return com.baselibrary.test.R.layout.re1;
    }

    @Override
    public void convert(MyViewHolder helper, listJson.DataBean item, int position) {

        if (item.urllist.size()>0){
            LinearLayout view = (LinearLayout)helper.getView(R.id.ll1);
            view.removeAllViews();
            for (int i = 0; i < item.urllist.size(); i++) {
                LogUtils.i("我现在的内容是"+item.urllist.get(i));
                myUi myUi = new myUi(mContext);
                myUi
                        .setImager(mContext,item.urllist.get(i).url)
                        .setTitle(item.urllist.get(i).name)
                ;
                view.addView(myUi);
            }
        }


    }
}
